﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using TCP;

namespace RixRoverControl
{
    class TcpControl : RoverControl
    {
        Client m_tcp_client;

        public TcpControl()
        {
            m_tcp_client = new Client();
        }

        void RoverControl.update()
        {
            byte[] b = {0};

            if (Input.Keyboard.IsKeyDown(Keys.W))
                b[0] |= 1 << 0;
            if (Input.Keyboard.IsKeyDown(Keys.S))
                b[0] |= 1 << 1;
            if (Input.Keyboard.IsKeyDown(Keys.A))
                b[0] |= 1 << 2;
            if (Input.Keyboard.IsKeyDown(Keys.D))
                b[0] |= 1 << 3;

            m_tcp_client.send(b);
        }

        void RoverControl.close()
        {
        }
    }
}
